﻿<%@ Page Language="C#" MasterPageFile="~/Navigations.Master" AutoEventWireup="true" CodeBehind="MassManager.aspx.cs" Inherits="WeChat.Manager.MassManager" Title="微信群发" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

<script type="text/javascript" language="javascript">
        function tips(){
            $("#mysTip").modal("show");
        }
        function clean(){
            $("[name='weixinh']").val("");
            $("[name='select1']").val("图文素材");
            $("[name='mediaId1']").val("");
        }
        function clean2(){
            $("#<%=selects.ClientID%>").val("图文素材");
            $("#<%=mediaId2.ClientID%>").val("");
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="container">
      <div class="row">
        <div class="col-md-1"></div>
        <div class="col-md-5">
            <div class="panel panel-info">
               <div class="panel-heading">
                  <h3 class="panel-title">微信群发测试</h3>
               </div>
               <div class="panel-body">
                           <div class="form-group">
                              <label for="name" class="col-md-3 control-label">用户id</label>
                              <div class="col-md-9">
                                 <input type="text" name="weixinh" class="form-control" placeholder="请输入测试的已关注用户的openid"/>
                              </div>
                           </div>
                            <div class="form-group">
                              <label for="firstname" class="col-md-3 control-label">素材类型</label>
                              <div class="col-md-9">
                                 <select name="select1" class="form-control">
                                     <option>图文素材</option>
                                     <option>图片素材</option>
                                     <option>文本素材</option>
                                     <option>语音素材</option>
                                     <option>视频素材</option>
                                  </select>
                              </div>
                           </div>
                           <div class="form-group">
                              <label for="lastname" class="col-md-3 control-label">素材ID</label>
                              <div class="col-md-9">
                                 <textarea name="mediaId1" class="form-control" rows="2" placeholder="请在此输入测试发送的素材ID或消息文本"></textarea>
                              </div>
                           </div>
               </div>
               <div class="panel-footer text-right">
                  <asp:Button ID="sends" class="btn btn-primary" runat="server" Text="发送" OnClick="sendMsgTest" />
                   <input id="Button3" type="button" class="btn btn-warning" value="清空" onclick="clean()" />
               </div>
            </div>
       </div>
       
       <div class="col-md-5">
            <div class="panel panel-info">
               <div class="panel-heading">
                  <h3 class="panel-title">微信消息群发</h3>
               </div>
               <div class="panel-body">
                      <form id="form2" class="form-horizontal" role="form">
                            <div class="form-group">
                              <label for="name" class="col-md-3 control-label">素材类型</label>
                              <div class="col-md-9">
                                 <select id="selects" runat="server" name="select2" class="form-control">
                                     <option>图文素材</option>
                                     <option>图片素材</option>
                                     <option>文本素材</option>
                                     <option>语音素材</option>
                                     <option>视频素材</option>
                                  </select>
                              </div>
                           </div>
                           <div class="form-group">
                              <label for="lastname" class="col-md-3 control-label">素材ID</label>
                              <div class="col-md-9">
                                  <asp:TextBox ID="mediaId2" runat="server" TextMode="MultiLine" Rows="3" class="form-control" placeholder="请在此输入需要群发的素材ID或消息文本"></asp:TextBox>
                                 <%--<textarea id="mediaId2" runat="server" class="form-control" rows="2" placeholder="请在此输入需要群发的素材ID或消息文本"></textarea>--%>
                              </div>
                           </div>
                    </form>
               </div>
               <div class="panel-footer text-right">
                  <asp:Button ID="newInfo" class="btn btn-primary" runat="server" Text="发送" OnClick="sendMsg" />
                   <input id="Button2" type="button" class="btn btn-warning" value="清空" onclick="clean2()" />
               </div>
            </div>
       </div>
      <div class="col-md-1"></div>
    </div>
    </div>

<div class="container">
      <div class="row">
        <div class="col-md-1"></div>
        <div class="col-md-10">
            <div class="panel panel-danger">
               <div class="panel-heading">
                  <h3 class="panel-title">微信群发记录</h3>
               </div>
               <div class="panel-body">
               <asp:Button ID="Button1" class="btn btn-primary" runat="server" Text="查看记录" OnClick="showMassMsg" />
               </div>
               <asp:Repeater id="massReports" runat="server">
                    <HeaderTemplate>
                    <table class="table table-hover">
                    <tr>
                    <th>消息类型</th>
                    <th>消息ID</th>
                    <th>创建时间</th>
                    <th>群发结果</th>
                    <th>用户总数</th>
                    <th>预发送数</th>
                    <th>发送成功</th>
                    <th>发送失败</th>
                    </tr>
                    </HeaderTemplate>

                    <ItemTemplate>
                    <tr>
                    <td><%# Eval("MsgType")%></td>
                    <td><%# Eval("MsgID")%></td>
                    <td><%# Eval("createtime")%></td>
                    <td><%# Eval("Status")%></td>
                    <td><%# Eval("TotalCount")%></td>
                    <td><%# Eval("FilterCount")%></td>
                    <td><%# Eval("SentCount")%></td>
                    <td><%# Eval("ErrorCount")%></td>
                    </tr>
                    </ItemTemplate>

                    <FooterTemplate>
                    </table>
                    </FooterTemplate>
                 </asp:Repeater>
            </div>
       </div>
      <div class="col-md-1"></div>
    </div>
</div>


    

   <!--rating modal's content-->
<div class="modal fade" id="mysTip" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
   <div class="modal-dialog">
      <div class="modal-content">
          <div class="modal-header">
              <button type="button" class="close" data-dismiss="modal">&times;</button>
              <h4>提示</h4>
            </div><!--Modal header-->
            <div class="modal-body"><h3><asp:Label ID="Label1" runat="server"></asp:Label></h3>
            </div><!--Modal body-->
            <div class="modal-footer">
              <a href="#" class="btn btn-default" data-dismiss="modal" >关闭</a>
            </div><!--Modal footer-->
      </div><!-- /.modal-content -->
</div><!-- /.modal -->
</asp:Content>